package com.miao.test.common.enums;

/**
 * @Auther: miaoguoxin
 * @Date: 2021/2/25 17:29
 * @Description:
 */
public enum TargetType {
    PERSON(1, "个人"),
    GROUP(2, "群"),
    ;
    private int code;

    private String value;

    TargetType(int code, String value) {
        this.code = code;
        this.value = value;
    }

    public static TargetType getByCode(int code) {
        for (TargetType e : TargetType.values()) {
            if (e.getCode() == code) {
                return e;
            }
        }
        return null;
    }

    public int getCode() {
        return code;
    }

    public String getValue() {
        return value;
    }
}
